package Operation;

import Account.Account;
import Account.AcountList;

import java.util.Scanner;

public class WithdrawMoneyOperation extends IOperation{
    public WithdrawMoneyOperation() {
    }

    @Override
    public void work(Account account,AcountList acountList) {
      boolean ba = true;
        Scanner scanner = new Scanner(System.in);
       while(ba){
           System.out.println("请输入取款余额");
           double Num = scanner.nextDouble();
           if(Num>account.getMoney()){
               System.out.println("账户余额不足");
           }else{
                ba = false;
                account.setMoney(account.getMoney()-Num);
               System.out.println("取款成功");
           }
           System.out.println("请选择是否退出:退出输入》00");
            String t = scanner.next();
            ba = !t.equals("00");
       }


    }
}
